#include <stdio.h>
#include "add.h"
#include "sub.h"
#include "mul.h"
#include "div.h"

int main() {
    int a, b;
    char op;

    printf("请输入两个整数和运算符（+ - * /）：");
    scanf("%d %c %d", &a, &op, &b);

    switch (op) {
        case '+':
            printf("结果：%d\n", add(a, b));
            break;
        case '-':
            printf("结果：%d\n", sub(a, b));
            break;
        case '*':
            printf("结果：%d\n", mul(a, b));
            break;
        case '/':
            if (b != 0) {
                printf("结果：%d\n", divide(a, b));
            } else {
                printf("错误：除数不能为零！\n");
            }
            break;
        default:
            printf("错误：无效的运算符！\n");
    }

    return 0;
}
